<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title><spring:message code="head.clothGarment"></spring:message>-<spring:message code="head.fabricDetail"></spring:message></title>
    <link href="${pageContext.request.contextPath }/phone/css/detail.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath }/phone/css/font/iconfont.css" rel="stylesheet" />
</head>
<body>
    <div class="ofl">
        <!--头部--有分类-->
        <div class="buliao_top">
            <a href="javascript:history.go(-1);"></a>
            <div class="top"><spring:message code="head.fabricCatalogue"></spring:message></div>
        </div>
        <div role="main" class="main" style="background:#fff;padding-bottom:120px;">
           <div class="product_img" style="background-image:url(${pageContext.request.contextPath }/upload/compression/${fabric.fImg});"></div>
           <div class="cp_content">
               <ul class="cp_xx">
                   <li>
                   		<div class="guanzhu le">
		            		<c:if test="${attention==true }">
		            			<i onclick="attention(this,1,${fabric.fId});" class="icon Hui-iconfont Hui-iconfont-like2"></i>
		            		</c:if>
		            		<c:if test="${attention!=true }">
		            			<i onclick="attention(this,1,${fabric.fId});" class="icon Hui-iconfont Hui-iconfont-like"></i>
		            		</c:if>
		            	</div>
                   		<spring:message code="fabric.no"></spring:message>${fabric.fNo}
                   </li>
                   <li class="text-ri"><%-- <spring:message code="fabric.price2"></spring:message> --%>
                   		 
                   		<i>￥${fabric.fPrice}</i><spring:message code="fabricCatalogue.price"></spring:message>
                   </li>
                   <div class="clr"></div>
               </ul>
               <%-- <h4><spring:message code="fabric.phone.info"></spring:message></h4> --%>
               <ul class="cp_xx" style="margin-top:10px;">
                   <li><spring:message code="fabric.name"></spring:message>${fabric.fName}</li>
                   <li><spring:message code="fabric.no"></spring:message>${fabric.fNo}</li>
                   <li><spring:message code="fabric.place"></spring:message>${fabric.fOrigin}</li>
                   <li><spring:message code="fabric.supplier"></spring:message>${fabric.fMessage3}</li>
                   <li><spring:message code="fabric.material"></spring:message>${fabric.fMaterial}</li>
                   <li><spring:message code="fabric.weight"></spring:message>${fabric.fGProperty}g</li>
                   <li><spring:message code="fabric.door"></spring:message>${fabric.fOrdinary}</li>
                   <li><spring:message code="fabric.total"></spring:message>${fabric.fSales}</li>
                   <div class="clr"></div>
               </ul>
               <h4><spring:message code="head.fabricDetail"></spring:message></h4>
               <div class="lining-info-list">
                   <ul class="lining-info-left">
                        <li>
                            <div class="lining-info-left-co">
                                <img src="${pageContext.request.contextPath }/phone/img/q1.jpg">
                            </div>
                            <div class="lining-info-left-co-r">
                                <p><spring:message code="fabric.thickness"></spring:message></p>
                                <!--选择等级，百分比控制begin-->
                                <div class="star-percent actSlider">
                                    <div class="star-per"></div>
                                    <div class="star-bg" style='width:<c:choose><c:when test="${fabric.fThickness==1 }">20%;background-size:497%;</c:when><c:when test="${fabric.fThickness==2 }">40%;background-size:254%;</c:when><c:when test="${fabric.fThickness==3 }">60%;background-size:167%;</c:when><c:when test="${fabric.fThickness==4 }">80%;background-size:125%;</c:when><c:when test="${fabric.fThickness==5 }">100%;background-size:100%;</c:when><c:otherwise>0</c:otherwise></c:choose>'></div>
                                </div>
                                <!--选择等级，百分比控制end-->
                            </div>
                            <div class="clr"></div>
                        </li>
                        <li>
                            <div class="lining-info-left-co">
                                <img src="${pageContext.request.contextPath }/phone/img/q2.jpg">
                            </div>
                            <div class="lining-info-left-co-r">
                                <p><spring:message code="fabric.softness"></spring:message></p>
			                    <!--选择等级，百分比控制begin-->
			                    <div class="star-percent actSlider">
			                        <div class="star-per"></div>
			                        <div class="star-bg" style="width:<c:choose><c:when test="${fabric.fSoft==1 }">20%;background-size:497%;</c:when><c:when test="${fabric.fSoft==2 }">40%;background-size:254%;</c:when><c:when test="${fabric.fSoft==3 }">60%;background-size:167%;</c:when><c:when test="${fabric.fSoft==4 }">80%;background-size:125%;</c:when><c:when test="${fabric.fSoft==5 }">100%;background-size:100%;</c:when><c:otherwise>0</c:otherwise></c:choose>"></div>
			                    </div>
                                <!--选择等级，百分比控制end-->
                            </div>
                            <div class="clr"></div>
                        </li>
                        <li>
                            <div class="lining-info-left-co">
                                <img src="${pageContext.request.contextPath }/phone/img/q3.jpg">
                            </div>
                            <div class="lining-info-left-co-r">
                                <p><spring:message code="fabric.water"></spring:message></p>
			                    <!--选择等级，百分比控制begin-->
			                    <div class="star-percent actSlider">
			                        <div class="star-per"></div>
			                        <div class="star-bg" style="width:<c:choose><c:when test="${fabric.fAbsorption==1 }">20%;background-size:497%;</c:when><c:when test="${fabric.fAbsorption==2 }">40%;background-size:254%;</c:when><c:when test="${fabric.fAbsorption==3 }">60%;background-size:167%;</c:when><c:when test="${fabric.fAbsorption==4 }">80%;background-size:125%;</c:when><c:when test="${fabric.fAbsorption==5 }">100%;background-size:100%;</c:when><c:otherwise>0</c:otherwise></c:choose>"></div>
			                    </div>
                                <!--选择等级，百分比控制end-->
                            </div>
                            <div class="clr"></div>
                        </li>
                        <li>
                            <div class="lining-info-left-co">
                                <img src="${pageContext.request.contextPath }/phone/img/q4.jpg">
                            </div>
                            <div class="lining-info-left-co-r">
                                <p><spring:message code="fabric.fFold"></spring:message></p>
			                    <!--选择等级，百分比控制begin-->
			                    <div class="star-percent actSlider">
			                        <div class="star-per"></div>
			                        <div class="star-bg" style="width: <c:choose><c:when test="${fabric.fFold==1 }">20%;background-size:497%;</c:when><c:when test="${fabric.fFold==2 }">40%;background-size:254%;</c:when><c:when test="${fabric.fFold==3 }">60%;background-size:167%;</c:when><c:when test="${fabric.fFold==4 }">80%;background-size:125%;</c:when><c:when test="${fabric.fFold==5 }">100%;background-size:100%;</c:when><c:otherwise>0</c:otherwise></c:choose>"></div>
			                    </div>
                                <!--选择等级，百分比控制end-->
                            </div>
                            <div class="clr"></div>
                        </li>
                    </ul>

                    <ul class="lining-info-left">
                        <li>
                            <div class="lining-info-left-co">
                                <img src="${pageContext.request.contextPath }/phone/img/q5.jpg">
                            </div>
                            <div class="lining-info-left-co-r">
                                <p><spring:message code="fabric.guangdu"></spring:message></p>
			                    <!--选择等级，百分比控制begin-->
			                    <div class="star-percent actSlider">
			                        <div class="star-per"></div>
			                        <div class="star-bg" style="width:<c:choose><c:when test="${fabric.fPhotometric==1 }">20%;background-size:497%;</c:when><c:when test="${fabric.fPhotometric==2 }">40%;background-size:254%;</c:when><c:when test="${fabric.fPhotometric==3 }">60%;background-size:167%;</c:when><c:when test="${fabric.fPhotometric==4 }">80%;background-size:125%;</c:when><c:when test="${fabric.fPhotometric==5 }">100%;background-size:100%;</c:when><c:otherwise>0</c:otherwise></c:choose>"></div>
			                    </div>
                                <!--选择等级，百分比控制end-->
                            </div>
                            <div class="clr"></div>
                        </li>
                        <li>
                            <div class="lining-info-left-co">
                                <img src="${pageContext.request.contextPath }/phone/img/q6.jpg">
                            </div>
                            <div class="lining-info-left-co-r">
                                <p><spring:message code="fabric.elasticity"></spring:message></p>
			                    <!--选择等级，百分比控制begin-->
			                    <div class="star-percent actSlider">
			                        <div class="star-per"></div>
			                        <div class="star-bg" style="width:<c:choose><c:when test="${fabric.fElastic==1 }">20%;background-size:497%;</c:when><c:when test="${fabric.fElastic==2 }">40%;background-size:254%;</c:when><c:when test="${fabric.fElastic==3 }">60%;background-size:167%;</c:when><c:when test="${fabric.fElastic==4 }">80%;background-size:125%;</c:when><c:when test="${fabric.fElastic==5 }">100%;background-size:100%;</c:when><c:otherwise>0</c:otherwise></c:choose>"></div>
			                    </div>
                                <!--选择等级，百分比控制end-->
                            </div>
                            <div class="clr"></div>
                        </li>
                        <li>
                            <div class="lining-info-left-co">
                                <img src="${pageContext.request.contextPath }/phone/img/q7.jpg">
                            </div>
                            <div class="lining-info-left-co-r">
                                <p><spring:message code="fabric.air"></spring:message></p>
			                    <!--选择等级，百分比控制begin-->
			                    <div class="star-percent actSlider">
			                        <div class="star-per"></div>
			                        <div class="star-bg" style="width:<c:choose><c:when test="${fabric.fBreathable==1 }">20%;background-size:497%;</c:when><c:when test="${fabric.fBreathable==2 }">40%;background-size:254%;</c:when><c:when test="${fabric.fBreathable==3 }">60%;background-size:167%;</c:when><c:when test="${fabric.fBreathable==4 }">80%;background-size:125%;</c:when><c:when test="${fabric.fBreathable==5 }">100%;background-size:100%;</c:when><c:otherwise>0</c:otherwise></c:choose>"></div>
			                    </div>
                                <!--选择等级，百分比控制end-->
                            </div>
                            <div class="clr"></div>
                        </li>
                        <li>
                            <div class="lining-info-left-co">
                                <img src="${pageContext.request.contextPath }/phone/img/q8.jpg">
                            </div>
                            <div class="lining-info-left-co-r">
                                <p><spring:message code="fabric.trans"></spring:message></p>
			                    <!--选择等级，百分比控制begin-->
			                    <div class="star-percent actSlider">
			                        <div class="star-per"></div>
			                        <div class="star-bg" style="width:<c:choose><c:when test="${fabric.fTransparent==1 }">20%;background-size:497%;</c:when><c:when test="${fabric.fTransparent==2 }">40%;background-size:254%;</c:when><c:when test="${fabric.fTransparent==3 }">60%;background-size:167%;</c:when><c:when test="${fabric.fTransparent==4 }">80%;background-size:125%;</c:when><c:when test="${fabric.fTransparent==5 }">100%;background-size:100%;</c:when><c:otherwise>0</c:otherwise></c:choose>"></div>
			                    </div>
                                <!--选择等级，百分比控制end-->
                            </div>
                            <div class="clr"></div>
                        </li>
                    </ul>
               </div>
               <c:if test="${not empty picList }">
               <div class="content_img">
                   <c:forEach items="${picList }" var="pic">
			        	<img src="${pageContext.request.contextPath }/upload/compression/${pic.fpImg }" />
			        </c:forEach>
               </div>
               </c:if>

           </div>
        </div>
        <!---bottom底部--->
        <div class="bottom_buy">
            
           <%--  <div class="number">
                <label class="le"><spring:message code="fabric.phone.buyNo"></spring:message>：</label><input type="text" id="spinnerId" class="spinner"/>
            </div> --%>
            <div class="buy_btn">
            	<%-- <div class="guanzhu le">
            		<c:if test="${attention==true }">
            			<i onclick="attention(this,1,${fabric.fId});" class="icon Hui-iconfont Hui-iconfont-like2"></i>
            		</c:if>
            		<c:if test="${attention!=true }">
            			<i onclick="attention(this,1,${fabric.fId});" class="icon Hui-iconfont Hui-iconfont-like"></i>
            		</c:if>
            	</div> --%>
            	<div class="buy_a ri">
	                <a href="javascript:joincart(1);"><spring:message code="fabric.joincart"></spring:message></a>
	                <a href="javascript:buynow(2);"><spring:message code="fabric.buynow"></spring:message></a>
            	</div>
                <div class="clr"></div>
            </div>
        </div>



		<!-- 面料下单，颜色选择 -->
		<div class="goumai_div hide">
			<div class="bottom_goumai">
				<span class="bottom_close"><i class="Hui-iconfont Hui-iconfont-del"></i></span>
				<div class="bottom_xx">
					<ul>
						<li><span class="le1"><spring:message code="fabric.blarge"></spring:message></span><spring:message code="fabric.large"></spring:message></li>
						<li><span class="le2">￥${fabric.fPrice}</span>/<spring:message code="fabric.largeNo"></spring:message></li>
						<li><span class="le1"><spring:message code="fabric.bsmall"></spring:message></span><spring:message code="fabric.small"></spring:message></li>
						<li><span class="le2">￥${fabric.fPrice+15*fabric.fPrice/100}</span>/<spring:message code="fabric.smallNo"></spring:message></li>
						<li><span class="le1"><spring:message code="fabric.bclothVersion"></spring:message></span><spring:message code="fabric.clothVersion"></spring:message></li>
						<li><span class="le2">￥${fabric.fPrice+30*fabric.fPrice/100}</span>/<spring:message code="fabric.clothVersionNo"></spring:message></li>
						<div class="clr"></div>
					</ul>
				</div>
				<div class="select_color">
	      			<h4><spring:message code="fabric.color"></spring:message></h4>
	      			<div class="color_sel">
	      				<c:if test="${fn:length(colorPic)>3 }">
	      					<span class="le_arrow"></span>
	      				</c:if>
	      				<div class="sel_div" style="
	      				<c:if test="${fn:length(colorPic)>3 }">overflow-x: scroll;</c:if>
	      				-webkit-overflow-scrolling: touch;overflow-scrolling: touch;/* width:100%; */">
	      					<ul>
	      						<c:forEach items="${colorPic }" var="color" varStatus="c">
          							<li id="${color.fmpImg }" onclick="check(this);" <c:if test="${c.index==0 }">class="on"</c:if>>
          								<img src="${pageContext.request.contextPath }/upload/${color.fmpImg}">
          								<span></span>
       								</li>
          						</c:forEach>
	      						<div class="clr"></div>
	      					</ul>
	      				</div>
	      				<c:if test="${fn:length(colorPic)>3 }">
	      					<span class="ri_arrow"></span>
	      				</c:if>
	      			</div>
	      		</div>
	      		
	      		<div class="num_zong">
	      			<div class="num" onclick="getToltalMoney();">
	      				<label class="le"><spring:message code="fabric.num"></spring:message></label><span class="ri"><input type="text" id="spinnerId" class="spinner"/></span>
	      				<div class="clr"></div>
	      			</div>
	      			<div class="zong">
	      				<label class="le"><spring:message code="fabric.phone.totalMoney"></spring:message></label><label class="ri" id="totalMoney">￥${fabric.fPrice+30*fabric.fPrice/100}</label>
	      				<div class="clr"></div>
	      			</div>
	      		</div>
	      		
      			<div class="sure_mai">
      				<a href="javascript:sure();"><spring:message code="fabric.phone.sure"></spring:message></a>
      			</div>
	      	</div>	
		</div>
   </div>
   <input type="hidden" id="type" name="type" value="">
   <input type="hidden" id="price" value="${fabric.fPrice }">
     <form method="post" action="${pageContext.request.contextPath}/api/orders/viewinsertorders" id="form">
		<input type="hidden" id="pId" name="pId" >
		<input type="hidden" id="ppId" name="ppId">
		<input type="hidden" id="fId" name="fId" value="${fabric.fId}">
		<input type="hidden" id="size" name="size">
		<input type="hidden" id="status" name="status" value="3">
		<input type="hidden" id="colorImg" name="colorImg" value='<c:forEach items="${colorPic }" var="color" varStatus="c"><c:if test="${c.index==0 }">${color.fmpImg}</c:if></c:forEach>'>
	</form>
    <script src="${pageContext.request.contextPath }/phone/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/phone/js/jquery.spinner.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/layer/layer_mobile/layer.js"></script>
    <script type="text/javascript">
	//关闭弹出层
	$(".bottom_close,.sure_mai a").click(function(){
		$(".goumai_div").addClass("hide");
		
		$(".bottom_buy").css("bottom","0px");

	});
    
    
	//购买弹出层
	//$(".buy_btn a").click(function(){});
	//加入购物车
	function joincart(type){
		$(".goumai_div").removeClass("hide");
		$(".bottom_buy").css("bottom","150px");
		//因为是手机，所以宽度不确定，在这里要计算一下宽度。
	    var color_w = $(".color_sel").css("width").substr(0,$(".color_sel").css("width").length-2);
	    /* $(".sel_div").css("width",color_w-15*2); */

		$(".sel_div ul").css("width",52*$(".sel_div ul").find("li").length);//颜色选项的宽度计算。
		$("#type").val(type);
	}
	//立即购买
	function buynow(type){
		$(".goumai_div").removeClass("hide");
		$(".bottom_buy").css("bottom","150px");
		//因为是手机，所以宽度不确定，在这里要计算一下宽度。
	    var color_w = $(".color_sel").css("width").substr(0,$(".color_sel").css("width").length-2);
	    /* $(".sel_div").css("width",color_w-15*2); */

		$(".sel_div ul").css("width",52*$(".sel_div ul").find("li").length);//颜色选项的宽度计算。
		$("#type").val(type);
	}
	//计算总额
	function getToltalMoney(){
		var num=$("#spinnerId").val();//数量
		var price=$("#price").val();//单价
		var totalMoney="";
		if(num>500){
			totalMoney=parseInt(num-500)*parseFloat(price)+400*parseFloat(price)*115/100+100*parseFloat(price)*130/100;
		}else if(num<=100){
			totalMoney=parseInt(num)*parseFloat(price)*130/100;
		}else{
			totalMoney=parseInt(num-100)*parseFloat(price)*115/100+100*parseFloat(price)*130/100;
		}
		
		$("#totalMoney").html("￥"+totalMoney.toFixed(2));
	}
    
    
    //颜色选择
    //在外边放着，弹出层显示的时候，没有占位。
    //var color_w = $(".color_sel").css("width").substr(0,$(".color_sel").css("width").length-2);
    //$(".sel_div").css("width",color_w-15*2);
    
	/* $(".sel_div ul li").click(function(){
		$(this).addClass("on").siblings().removeClass("on");
	}); */
	function check(obj){
		$(obj).addClass("on").siblings().removeClass("on");
		$("#colorImg").val($(obj).attr('id'));
	}
	$("span.ri_arrow").click(function(){
		var str = $(".sel_div ul").css("left");
		var width = $(".sel_div ul").css("width").substr(0,$(".sel_div ul").css("width").length-2);
		var w_w = $(".sel_div").css("width").substr(0,$(".sel_div").css("width").length-2);
		var left = str.substr(0,str.length-2);
		var num = Math.abs(left);

		if(num == width){
			
		}else{
			if(num < (width - w_w)){//(width-52)
				$(".sel_div ul").css("left",str.substr(0,str.length-2)-52);
			}else{
				$(".sel_div ul").css("left",0);
			}
		}
	});

	$("span.le_arrow").click(function(){
		var str = $(".sel_div ul").css("left");
		var width = $(".sel_div ul").css("width").substr(0,$(".sel_div ul").css("width").length-2);
		var left = str.substr(0,str.length-2);
		var num = Math.abs(left);
		if(str == "0px"){
			
		}else{
			if(num < (width-52*2)){
				$(".sel_div ul").css("left",parseInt(str.substr(0,str.length-2))+52);
			 }else{
				$(".sel_div ul").css("left",0);
			 } 
		}
	});
        $('.spinner').spinner();
    	$(document).ready(function(){
    		//任凯伟 添加 
    		$(document).ajaxComplete(function(event, request, settings) {
    			var loginStatus = request.getResponseHeader("loginStatus");
    			if (loginStatus == "accessDenied") {
    				redirectLogin(location.href, "<spring:message code="head.notLogin"></spring:message>");
    			} 
    		});
    	});
     // 跳转登录
    	function redirectLogin(redirectUrl, message) {
    		var href ="${pageContext.request.contextPath }/api/toPhonePage/login";
    		if (redirectUrl != null) {
    			href += "?redirectUrl=" + encodeURIComponent(redirectUrl);
    		}
    		if (message != null) {
    			layer.open({
       			    content: '<spring:message code="flowertypecatalog.notLogin"></spring:message>'
       			    ,btn: ['<spring:message code="reciveAddress.confirm"></spring:message>', '<spring:message code="reciveAddress.cancel"></spring:message>']
       			    ,yes: function(index){
       			    	location.href = href;
       			      layer.close(index);
       			    }
       			  });
    			
    		} else {
    			location.href = href;
    		}
    	}
      //关注
        function attention(obj,type,aId){
        	$.ajax( {  
        		type : "POST",  
                 url : "${pageContext.request.contextPath }/member/member/attention",
                 data : {type:type,aId:aId},
                 success: function(data) {
                	 if(data == 1){//取消关注成功
                		 //layer.msg('<spring:message code="fabric.phone.sucCanAtt"></spring:message>',{icon:1,time:1000});
                		 layer.open({
         	   			    content: '<spring:message code="fabric.phone.sucCanAtt"></spring:message>'
         	   			    ,skin: 'msg'
         	   			    ,time: 1 //1秒后自动关闭
         	   			  });	 
                	 	$(obj).removeClass("Hui-iconfont-like2").addClass("Hui-iconfont-like");
                	 }else if(data == 2){//关注成功
                		 //layer.msg('<spring:message code="fabric.phone.sucAtt"></spring:message>',{icon:1,time:1000});
                		 layer.open({
         	   			    content: '<spring:message code="fabric.phone.sucAtt"></spring:message>'
         	   			    ,skin: 'msg'
         	   			    ,time: 1 //1秒后自动关闭
         	   			  });	 
                	 	$(obj).removeClass("Hui-iconfont-like").addClass("Hui-iconfont-like2");
                	 }else{
                		 layer.open({
         	   			    content: '<spring:message code="caozuoshibai"></spring:message>'
         	   			    ,skin: 'msg'
         	   			    ,time: 1 //1秒后自动关闭
         	   			  });
                		 //layer.msg('<spring:message code="caozuoshibai"></spring:message>',{icon:0,time:1000});
                	 }
                 }
        	});
        }
      //确认购买
        function sure(){
        	var type=$("#type").val();
        	var status=3;
        	var fId=$("#fId").val();
        	var count=$("#spinnerId").val();
        	var color=$("#colorImg").val();
        	if(color==""||color==null){
        		layer.open({
  	   			    content: '<spring:message code="fabric.colorError"></spring:message>'
  	   			    ,time: 1 //1秒后自动关闭
  	   			  });
        		return false;
        	}
        	//加入购物车
        	if(type==1){
        		
            	if(count>0){
            		$.ajax( {  
                		type : "POST",  
                         url : "${pageContext.request.contextPath }/web/shoppingcart/insertshoppingcart",
                         data : {status:status,fId:fId,size:count,colorImg:color},
                         success: function(data) {
                        	 if(data.msg.status==0){
                        		 layer.open({
                  	   			    content: '<spring:message code="member.sucjoincart"></spring:message>'
                  	   			    ,time: 1 //1秒后自动关闭
                  	   			  });
                        	 }
                         }
                	});
            	}
        	}
        	//直接购买
        	if(type==2){
            	if(count>0){
        			$("#size").val(count);
        			$("#status").val(3);
        			$.ajax( {  
                		type : "POST",  
                         url : "${pageContext.request.contextPath }/web/member/isLogin",
                         success: function(data) {
                        	 if(data){
                        		 $("#form").submit();
                        	 }else{
                        		 var href ="${pageContext.request.contextPath }/api/toPhonePage/login?redirectUrl=" + encodeURIComponent(window.location.href);
                        		 layer.open({
                       			    content: '<spring:message code="flowertypecatalog.notLogin"></spring:message>'
                       			    ,btn: ['<spring:message code="reciveAddress.confirm"></spring:message>', '<spring:message code="reciveAddress.cancel"></spring:message>']
                       			    ,yes: function(index){
                       			    	location.href = href;
                       			      layer.close(index);
                       			    }
                       			  });
                        	 }
                         }
                	});
            	}
        	}
        }
    </script>
</body>
</html>
